﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:local="clr-namespace:XingZhe" 
	xmlns:Primitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone">

        <local:ThemeSetting x:Key="ThemeSetting"/>
        
        <!--<SolidColorBrush x:Key="TextForeground" Color="#FF00FF00" />-->
        <!-- 应该在此定义资源字典条目-->
        <Style x:Key="PivotStyle" TargetType="phone:Pivot">
                <Setter Property="Margin" Value="0"/>
                <Setter Property="Padding" Value="0"/>
                <Setter Property="Foreground" Value="{StaticResource ResourceKey=PhoneForegroundBrush}"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="Template">
                        <Setter.Value>
                                <ControlTemplate TargetType="phone:Pivot">
                                        <!--<Grid Background="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">-->
                                        <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
                                                <Grid.RowDefinitions>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Grid Background="{TemplateBinding Background}" Grid.RowSpan="3"/>
                                                <ItemsPresenter x:Name="PivotItemPresenter"  Margin="0,-20,0,0" Grid.Row="2" />
                                                <Border  BorderThickness="0,0,0,1" BorderBrush="#11000000" Grid.Row="1">
                                                        <Border  BorderThickness="0,0,0,1" BorderBrush="#22000000">
                                                                <Border  BorderThickness="0,0,0,1" BorderBrush="#33000000">
                                                                        <Border Grid.Row="0" Grid.RowSpan="2" Margin="0,0,0,0" BorderBrush="White"  BorderThickness="0,0,0,1">
                                                                                <Border.Background>
                                                                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0,0">
                                                                                                <GradientStop  Color="#FFFFFFFF"  Offset="1"></GradientStop>
                                                                                                <GradientStop  Color="#FFF0F0F0" Offset="0"></GradientStop>
                                                                                        </LinearGradientBrush>
                                                                                </Border.Background>
                                                                                <Primitives:PivotHeadersControl x:Name="HeadersListElement" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                                                                                        <Primitives:PivotHeadersControl.ItemContainerStyle>
                                                                                                <Style TargetType="Primitives:PivotHeaderItem">
                                                                                                        <Setter Property="Background" Value="Transparent"/>
                                                                                                        <Setter Property="Padding" Value="20,0,8,20"/>
                                                                                                        <Setter Property="Margin" Value="0"/>
                                                                                                        <!--<Setter Property="Foreground" Value="{StaticResource ResourceKey=Phone}"/>-->
                                                                                                        <Setter Property="FontSize" Value="60"/>
                                                                                                        <!--<Setter Property="FontSize" Value="{StaticResource ResourceKey=PhoneFontSizeExtraLarge}"/>-->
                                                                                                        <Setter Property="Template">
                                                                                                                <Setter.Value>
                                                                                                                        <ControlTemplate TargetType="Primitives:PivotHeaderItem">
                                                                                                                                <Grid>
                                                                                                                                        <VisualStateManager.VisualStateGroups>
                                                                                                                                                <VisualStateGroup x:Name="SelectionStates">
                                                                                                                                                        <VisualState x:Name="Unselected"/>
                                                                                                                                                        <VisualState x:Name="Selected">
                                                                                                                                                                <Storyboard>
                                                                                                                                                                        <DoubleAnimation Duration="0"
                                                                                                                                         To="1"
                                                                                                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                                                                         Storyboard.TargetName="contentPresenter"/>
                                                                                                                                                                        <DoubleAnimation Duration="0"
                                                                                                                                         To="1"
                                                                                                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                                                                         Storyboard.TargetName="gridArrow"/>
                                                                                                                                                                </Storyboard>
                                                                                                                                                        </VisualState>
                                                                                                                                                </VisualStateGroup>
                                                                                                                                        </VisualStateManager.VisualStateGroups>



                                                                                                                                        <Grid>
                                                                                                                                                <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" x:Name="gridArrow" Opacity="0">
                                                                                                                                                        <Path  Width="32" 
													Height="16" 
                                                                                                    Data="M0,16 L16,0 32,16"
                                                                                                    Fill="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}"  
                                                                                                    Margin="0,0,0,0"
                                                                                                    VerticalAlignment="Bottom"
                                                                                                    HorizontalAlignment="Center"  StrokeThickness="0"></Path>
                                                                                                                                                        <Path  Width="32" 
													Height="16" 
                                                                                                    Data="M0,16 L16,0 32,16"
                                                                                                    Fill="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}"  
                                                                                                    Margin="0,1,0,-1"
                                                                                                    VerticalAlignment="Bottom"
                                                                                                    HorizontalAlignment="Center"  StrokeThickness="1"  Stroke="White"></Path>
                                                                                                                                                        <Path  Width="32" 
													Height="16" 
                                                                                                    Data="M0,16 L16,0 32,16"
                                                                                                    Fill="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}"  
                                                                                                    Margin="0,2,0,-2"
                                                                                                    VerticalAlignment="Bottom"
                                                                                                    HorizontalAlignment="Center"  StrokeThickness="1"  Stroke="#33000000"></Path>
                                                                                                                                                        <Path  Width="32" 
													Height="16" 
                                                                                                    Data="M0,16 L16,0 32,16"
                                                                                                    Fill="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}"  
                                                                                                    Margin="0,3,0,-3"
                                                                                                    VerticalAlignment="Bottom"
                                                                                                    HorizontalAlignment="Center"  StrokeThickness="1"  Stroke="#22000000"></Path>
                                                                                                                                                        <Path  Width="32" 
													Height="16" 
                                                                                                    Data="M0,16 L16,0 32,16"
                                                                                                    Fill="{Binding Path=Current.PageBackground, Source={StaticResource ResourceKey=ThemeSetting}}"  
                                                                                                    Margin="0,4,0,-4"
                                                                                                    VerticalAlignment="Bottom"
                                                                                                    HorizontalAlignment="Center"  StrokeThickness="1"  Stroke="#11000000"></Path>

                                                                                                                                                </Grid>
                                                                                                                                                <TextBlock  x:Name="contentPresenter" 
                                                                                                                                                        FontSize="60"
                                                                                                                                                        Text="{TemplateBinding Property=Content}"
                                                                                                                                                        Margin="{TemplateBinding Padding}" 
                                                                                                                                                        Opacity="{StaticResource PhonePivotUnselectedItemOpacity}"
                                                                                                                                                        Foreground="{Binding Path=Current.PivotItemHeaderForeground, Source={StaticResource ResourceKey=ThemeSetting}}"></TextBlock>
                                                                                                                                                <!--<ContentPresenter x:Name="contentPresenter"
                                                                                                                                                         Content="{TemplateBinding Content}"
                                                                                                                                                         Opacity="{StaticResource PhonePivotUnselectedItemOpacity}"
                                                                                                                                                         ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                                                                                                         HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                                                                                                         
                                                                                                                                                         Margin="{TemplateBinding Padding}" />-->
                                                                                                                                        </Grid>
                                                                                                                                </Grid>
                                                                                                                        </ControlTemplate>
                                                                                                                </Setter.Value>
                                                                                                        </Setter>
                                                                                                </Style>
                                                                                        </Primitives:PivotHeadersControl.ItemContainerStyle>
                                                                                </Primitives:PivotHeadersControl>
                                                                        </Border>
                                                                </Border>
                                                        </Border>
                                                </Border>
                                                <ContentControl ContentTemplate="{TemplateBinding TitleTemplate}" Content="{TemplateBinding Title}" HorizontalAlignment="Stretch" Margin="0" Style="{StaticResource PivotTitleStyle}"/>
                                        </Grid>
                                </ControlTemplate>
                        </Setter.Value>
                </Setter>
        </Style>
</ResourceDictionary>